#pragma once

//#include "../dxvk/dxvk_shader.h"
#include <stdint.h>

#include "../util/com/com_guid.h"
#include "../util/com/com_object.h"
#include "../util/com/com_pointer.h"

#include "../util/log/log.h"
#include "../util/log/log_debug.h"

#include "../util/rc/util_rc.h"
#include "../util/rc/util_rc_ptr.h"

#include "../util/util_bit.h"
#include "../util/util_enum.h"
#include "../util/util_error.h"
#include "../util/util_string.h"

#include "../util/util_flags.h"

#include <vulkan/vulkan_core.h>
#include <spirv/unified1/spirv.hpp>

enum DxvkLimits : size_t {
    MaxNumRenderTargets = 8,
    MaxNumVertexAttributes = 32,
    MaxNumVertexBindings = 32,
    MaxNumXfbBuffers = 4,
    MaxNumXfbStreams = 4,
    MaxNumViewports = 16,
    MaxNumResourceSlots = 1216,
    MaxNumActiveBindings = 128,
    MaxNumQueuedCommandBuffers = 12,
    MaxNumQueryCountPerPool = 128,
    MaxNumSpecConstants = 12,
    MaxUniformBufferSize = 65536,
    MaxVertexBindingStride = 2048,
    MaxPushConstantSize = 128,
};

enum class DxvkSpecConstantId : uint32_t {
    /// Special constant ranges that do not count
    /// towards the spec constant min/max values
    ColorComponentMappings = MaxNumResourceSlots,

    // Specialization constants for pipeline state
    SpecConstantRangeStart = ColorComponentMappings + MaxNumRenderTargets * 4,
    RasterizerSampleCount = SpecConstantRangeStart + 0,
    FirstPipelineConstant
};

struct DxvkInterfaceSlots {
    uint32_t inputSlots = 0;
    uint32_t outputSlots = 0;
    uint32_t pushConstOffset = 0;
    uint32_t pushConstSize = 0;
};


/**
   * \brief Resource slot
   *
   * Describes the type of a single resource
   * binding that a shader can access.
   */
struct DxvkResourceSlot {
    uint32_t           slot;
    VkDescriptorType   type;
    VkImageViewType    view;
    VkAccessFlags      access;
};